Page({
  data: {
    registerList: []
  },
  onLoad() {
    this.getRegisterData();
  },
  getRegisterData() {
    wx.showLoading({
      title: '加载中...'
    });
    
    // 模拟网络请求
    wx.request({
      url: 'https://api.example.com/register/list',
      method: 'GET',
      header: {
        'content-type': 'application/json'
      },
      success: (res) => {
        console.log('挂号数据:', res.data);
        const data = res.data as any;
        this.setData({
          registerList: data.list || []
        });
      },
      fail: (err) => {
        console.error('获取挂号数据失败:', err);
        wx.showToast({
          title: '获取数据失败',
          icon: 'none'
        });
      },
      complete: () => {
        wx.hideLoading();
      }
    });
  }
}); 